package org.hzero.business.workflow.builder;

import org.activiti.rest.service.api.engine.variable.RestVariable;
import org.activiti.rest.service.api.runtime.process.ProcessInstanceCreateRequest;

/**
 * @ClassName: WorkflowRequestBuilder
 * @Description: 工作流启动参数reques构造器
 * @author: tianhao.luo@hand-china.com
 * @date: 2020/9/4  14:51
 */
public interface KnifeWorkflowRequestBuilder {

    /**
     * 工作流request构建时，需要的参数类型
     */
    interface Constants{
        String FIELD_LONG_TYPE = "long";
        String FIELD_DOUBLE_TYPE = "double";
        String FIELD_STRING_TYPE = "string";
        String FIELD_INT_TYPE = "int";

    }

    /**
     * 构造key
     * @param processDefinitionKey 流程定义key
     * @return builder
     */
    KnifeWorkflowRequestBuilder buildProcessDefinitionKey(String processDefinitionKey);

    /**
     * 构建业务key
     * @param businessKey 业务key
     * @return builder
     */
    KnifeWorkflowRequestBuilder buildBusinessKey(String businessKey);


    /**
     * 构造流程变量
     * @param fieldName 属性名称
     * @param value 属性值
     * @param valueType 属性类型
     * @param restVariableScope 变量范围对象
     * @return builder
     */
    KnifeWorkflowRequestBuilder buildVariable(String fieldName, Object value, String valueType, RestVariable.RestVariableScope restVariableScope);


    /**
     * 生成工作流输入的请求参数
     * @return 生产工作流所需参数
     */
    ProcessInstanceCreateRequest build();


}
